home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / falcon / nt_dsp2.lzh / NT_DSP2.MSA / BENCH / 7-56.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-10-10  |  2.1 KB  |  60 lines

  1.      page 132,66,0,6
  2. ;********************************************
  3. ;Motorola Austin DSP Operation  June 30, 1988
  4. ;********************************************
  5. ;DSP56000/1
  6. ;Dot Product
  7. ;File name: 7-56.asm
  8. ;**************************************************************************
  9. ;    Maximum execution time: 585.4 ns at 20.5MHz/ 444.4 ns at 27.0MHz
  10. ;    Memory Size: Prog: 6 words ; Data: 4 words (if z uses the same 
  11. ;                                                   address as x1 or x2)  
  12. ;    Number of clock cycles:  12 (6 instruction cycles)
  13. ;    Clock Frequency:    20.5 MHz / 27.0 MHz
  14. ;    Cycle time:         97.5ns   / 74.1ns
  15. ;**************************************************************************
  16. ;       This routine performs the scalar product of two
  17. ;       [2x1] vectors on the DSP56000. 
  18. ;
  19. ;       Vector a is in X memory, 
  20. ;       vector b is in Y memory, 
  21. ;       the result z is stored in X memory.
  22. ;
  23. ;**************************************************************************
  24. ;
  25. ;     X Memory                     Y Memory
  26. ;
  27. ; |  | x2 |          |->|  y2 |
  28. ; |->| x1 |          |->|  y1 |
  29. ; r0 |    |          r0 |     |
  30. ;
  31. ; |->| z  |              
  32. ;
  33. ;
  34. ;Note: the previous assumes that all immediate addressing is
  35. ;immediate short, i.e. all data is in internal memory.
  36. ;
  37. ;**************************************************************************
  38. ;
  39. veca    equ     $010
  40. z       equ     $010
  41.  
  42.         org     x:veca
  43.         dc      $600000
  44.         dc      $400000
  45.  
  46.         org     y:veca
  47.         dc      $300000
  48.         dc      $100000
  49.  
  50.         org     p:$40
  51. ;************************************************************
  52.         move #<veca,r0                   ;point to vectors a,b
  53.         move #<z,r1                      ;point to z
  54.         move            l:(r0)+,x       ;load first elements.
  55.         mpy  x0,x1,a    l:(r0)+,x       ;a1*b1
  56.         macr x0,x1,a                    ;+a2*b2
  57.         move            a,x:(r0)        ;--> z
  58. ;*************************************************************
  59.         end
  60. ə